import UIKit
import Foundation
@objc public protocol FYCustomToolsProtocol: NSObjectProtocol {
    @objc optional func fy_applictionIdentifier() -> String
    @objc optional func fy_applictionSalt() -> String
    @objc optional func fy_applictionBaseUrl() -> String
    @objc optional func fy_applictionUserId() -> String
    @objc optional func fy_applictionToken() -> String
    @objc optional func fy_applictionPhone() -> String
    @objc optional func fy_applicationNeedReLogin()
    @objc optional func fy_applicationNeedUpgrade()
}
@objcMembers
open class FYCustomTools {
    public static let shared = FYCustomTools()
    public weak var delegate: FYCustomToolsProtocol?
    public static func didFinishLaunch() {
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.setDefaultMaskType(.black)
        SVProgressHUD.setMinimumDismissTimeInterval(1.5)
        SVProgressHUD.setMaximumDismissTimeInterval(60)
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.shouldResignOnTouchOutside = true
        IQKeyboardManager.shared.enableAutoToolbar = true
        IQKeyboardManager.shared.keyboardDistanceFromTextField = 100
        IQKeyboardManager.shared.previousNextDisplayMode = .alwaysHide
        IQKeyboardManager.shared.toolbarDoneBarButtonItemText = "Done"
    }
}
extension FYCustomTools {
    public var applictionID: String {
        return FYCustomTools.shared.delegate?.fy_applictionIdentifier?() ?? ""
    }
    public var applictionSalt: String {
        return FYCustomTools.shared.delegate?.fy_applictionSalt?() ?? ""
    }
    public var applictionBaseUrl: String {
        return FYCustomTools.shared.delegate?.fy_applictionBaseUrl?() ?? ""
    }
    public var applictionUserId: String {
        return FYCustomTools.shared.delegate?.fy_applictionUserId?() ?? ""
    }
    public var applictionToken: String {
        return FYCustomTools.shared.delegate?.fy_applictionToken?() ?? ""
    }
    public var applictionPhone: String {
        return FYCustomTools.shared.delegate?.fy_applictionPhone?() ?? ""
    }
}
